﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;
using VMDS.Business.Entities;

namespace VMDS.Services.Contracts
{ 
    [ServiceContract]
    public interface IMainServiceContract
    {
        [OperationContract]
        List<Task> GetAllTasks();

        [OperationContract]
        void CompleteTask(int Id);

        [OperationContract]
        bool TestRights();

        [OperationContract]
        List<Task> GetMyTasks(string MyName);
        [OperationContract]
        List<VM> GetVMs();
        [OperationContract]
        List<OS> GetOSs();
        [OperationContract]
        string GetShareUNC();

        [OperationContract]
        string GetUpdateUNC();
        [OperationContract]
        void AddOs(string name);
        [OperationContract]
        void DeleteOS(int OsId);

        [OperationContract]
        void AddTasks(List<Task> list);

        [OperationContract]
        void DeleteTask(Task t);

        [OperationContract]
        int AddVm(VM vm);

        [OperationContract]
        void UpdateVm(VM vm);

        [OperationContract]
        void DeleteVM(int VmId);
        
        [OperationContract]
        List<ClientPC> GetPCs();
        [OperationContract]
        void AddPC(ClientPC pc);

        [OperationContract]
        void RemovePC(ClientPC pc);

        [OperationContract]
        void AddPCs(List<ClientPC> pcs);

        [OperationContract]
        List<ClientPC> GetOnlinePCs();

        [OperationContract]
        List<string> GetUnknownPCs();

    }

    public interface IClientCallBack
    {
        [OperationContract(IsOneWay = true)]
        void OnTaskChanged(TaskDataPack task);
        [OperationContract(IsOneWay = true)]
        
        void OnTaskAdded(TaskDataPack task);
        [OperationContract(IsOneWay = true)]
        
        void OnTaskCmpleted(TaskDataPack task);
    }
  [ServiceContract(CallbackContract = typeof(IClientCallBack))]
  public interface IClientServiceContract
    {
        [OperationContract]
        void Register();
        [OperationContract]
      List<VM> GetOnlineVMs();
        [OperationContract]
      List<VM> GetOfflineVMs();
        [OperationContract]
        void Deploy(int id);

        [OperationContract]
        List<TaskDataPack> GetCurrentOperations();
        [OperationContract]
        bool CheckUpdate();
        [OperationContract]
        void  Update();

  }
}
